<script setup lang="ts">
  import {useRouter} from "vue-router";

  const props = defineProps<{
    data: any
  }>();
  const data = props.data;

  const router = useRouter()
  function returnInstrument(){
    sessionStorage.setItem("returnInstrument", JSON.stringify(data));
    router.push({name: "instrumentReturn"})
  }
</script>

<template>
  <van-cell>
    <div style="text-align: left; color: #000; font-size: 0.80rem; margin: 0 8px">
      <p>借用位置: {{ data.borrowFloorName }} {{ data.borrowRoomSubType }} {{ data.borrowRoomNumber }}</p>
      <p>归还位置: {{ data.returnFloorName }} {{ data.returnRoomSubType }} {{ data.returnRoomNumber }}</p>
      <p>借用时间: {{ data.borrowTime }}</p>
      <p>归还时间: {{ data.returnTime }}</p>
      <p>申请人: {{ data.realName }}</p>
      <p>备注: {{ data.remark }}</p>
    </div>
  </van-cell>
  <van-cell v-if="data.status == 'APPROVED'">
    <van-button type="primary" style="height: 35px;" @click="returnInstrument()">我要归还</van-button>
  </van-cell>
</template>


<style scoped>
  p {
    margin: 6px 6px 6px 0;
  }
</style>